package org.example.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by leo.wang on 2017/8/10.
 * Description:
 */
@Configuration
@EnableSwagger2
//@Profile({ "dev", "test", "uat"})
public class SwaggerConfig {
//    @Value("${swagger.enabled}")
//    private Boolean enabled;

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("e掌柜服务后台API文档")
                .description("API文档说明")
                .version("0.0.1")
                .build();
    }
}
